.class public Lnet/tsapps/topdeals/views/LoadingView;
.super Landroid/view/View;


# instance fields
.field private a:Landroid/graphics/Movie;

.field private b:J


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2

    invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f020027

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->openRawResource(I)Ljava/io/InputStream;

    move-result-object v0

    invoke-static {v0}, Landroid/graphics/Movie;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Movie;

    move-result-object v0

    iput-object v0, p0, Lnet/tsapps/topdeals/views/LoadingView;->a:Landroid/graphics/Movie;

    return-void
.end method


# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 8

    const/4 v7, 0x0

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v1

    iget-wide v3, p0, Lnet/tsapps/topdeals/views/LoadingView;->b:J

    const-wide/16 v5, 0x0

    cmp-long v0, v3, v5

    if-nez v0, :cond_0

    iput-wide v1, p0, Lnet/tsapps/topdeals/views/LoadingView;->b:J

    :cond_0
    iget-object v0, p0, Lnet/tsapps/topdeals/views/LoadingView;->a:Landroid/graphics/Movie;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lnet/tsapps/topdeals/views/LoadingView;->a:Landroid/graphics/Movie;

    invoke-virtual {v0}, Landroid/graphics/Movie;->duration()I

    move-result v0

    if-nez v0, :cond_1

    const/16 v0, 0x3e8

    :cond_1
    iget-wide v3, p0, Lnet/tsapps/topdeals/views/LoadingView;->b:J

    sub-long/2addr v1, v3

    int-to-long v3, v0

    rem-long v0, v1, v3

    long-to-int v0, v0

    iget-object v1, p0, Lnet/tsapps/topdeals/views/LoadingView;->a:Landroid/graphics/Movie;

    invoke-virtual {v1, v0}, Landroid/graphics/Movie;->setTime(I)Z

    iget-object v0, p0, Lnet/tsapps/topdeals/views/LoadingView;->a:Landroid/graphics/Movie;

    invoke-virtual {v0, p1, v7, v7}, Landroid/graphics/Movie;->draw(Landroid/graphics/Canvas;FF)V

    invoke-virtual {p0}, Lnet/tsapps/topdeals/views/LoadingView;->invalidate()V

    :cond_2
    return-void
.end method
